# -*- coding:utf-8 -*-
"""
Author：Administrator
Date:2022年01月12日
"""
import requests
from lxml import etree
import pandas as pd

headers = {"User-Agent": "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/97.0.4692.71 Safari/537.36"}

for i in range(1,4):
	url = f"https://www.jkl.com.cn/shopLis.aspx?current={i}&TypeId=10045"
	resp = requests.get(url=url,headers=headers).text
	解析1 = etree.HTML(resp)
	店铺名称 = 解析1.xpath('//span[@class="con01"]/text()')
	详细地址 = 解析1.xpath('//span[@class="con02"]/text()')
	电话号码 = 解析1.xpath('//span[@class="con03"]/text()')
	营业时间 = 解析1.xpath('//span[@class="con04"]/text()')
	数据 = pd.DataFrame({'店名': 店铺名称, '地址': 详细地址, '电话': 电话号码, '营业时间': 营业时间})
	数据.to_csv('./店铺信息1.csv', index=False, header=0, mode='a', encoding='ANSI')
